import unittest
from test_cases import test_demo1, test_demo2

# 方式一：创建一个加载器对象
loader = unittest.TestLoader()
loader1 = loader.loadTestsFromTestCase(test_demo1.TestDemo1TestCase)
loader2 = loader.loadTestsFromTestCase(test_demo2.TestDemo2TestCase)

# 创建一个测试套件
suite = unittest.TestSuite()
suite.addTest(loader1)
suite.addTest(loader2)

# 创建执行器,执行测试类
runner = unittest.TextTestRunner()
runner.run(suite)
